package com.uam.core.entity.constant;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

/**
 * @author heguanglong
 * @date 2021-03-13
 * Description: 缓存常量
 **/
public interface Constant {
     /**
      * 查询易图通每次返回的最大数量
      */
     int POI_MAP_SELECT_SIZE = 100;


     /**
      * 数据库DELETED为0
      */
     int DB_DELETED_0 = 0;

     /**
      * 数据库DELETED为1
      */
     int DB_DELETED_1 = 1;
     int ONE = 1;
     int TWO = 2;
     int THREE = 3;
     int FOUR = 4;
     int FIVE = 5;
     int ZERO = 0;
     int HASH_MAP_DEFAULT_SIZE = 64;
     int TWELVE = 12;
     int ELEVEN = 11;
     int FIFTEEN = 15;
     int DAY_MILLISECOND = 86400000;
     int DAY_SECOND = 86400;
     String TIMEZONE = "GMT+8";

     String REQUEST_POST = "POST";
     String REQUEST_PUT = "PUT";
     String REQUEST_DELETE = "DELETE";

     int NEGATIVE_ONE = -1;

     /**
      * 轨迹抽稀默认值
      */
     Double SIMPLIFY = 0.0003;

     /**
      * 轨迹绑路默认精度
      */
     Integer ACCURACY = 10;

     /**
      * 需要轨迹补偿距离
      */
     double DISTANCE_APART = 5000;

     String ORDER_DESC="DESC";
     String ORDER_ASC="ASC";

     String SORT_ASC = "ASC";

     String SORT_DESC = "DESC";

     int ES_DEFAULT_SIZE = 500;

    /**
     * 项目的版本号，所有url地址必须带
     */
    String version = "v1";
    String VERSION_V2 = "v2";
    String SERVER_MODEL_USER_TRACK_V2 = "/" + VERSION_V2 + "/import";
    /**
     * 服务接口拦截器根地址
     */
    String SERVER_PATH_INTERCEPTOR = "/" + version+ "/group/track";

    String ATTRVAL_THIS = ".";
    int ONE_HUNDRED = 100;


     /**
      * token标志
      */
     String TOKEN_SIGN = "accessToken";

     /**
      * 全中国区域编码
      */
     String ALL_CHINA_AREA_CODE = "100000";



     int EIGHT = 8;

     /**
      * 可以为中文、大小写英文、支持的符号为英文减号”-”、英文下划线”_”及英文句号”.”，符号不能作为字段的开头 字符不能超过128个
      */
     String REGEX_VALUE = "^(?!-)[a-zA-Z-\u4E00-\u9FA5][a-zA-Z0-9-\u4E00-\u9FA5_.\\-]{0,128}$";

     /**
      * 可以为中文、大小写英文、支持的符号为英文减号”-”、英文下划线”_”及英文句号”.”，符号不能作为字段的开头 字符不能超过128个
      */
     String REGEX_VALUE_NUM = "^(?!-)[a-zA-Z-0-9\u4E00-\u9FA5][a-zA-Z0-9-\u4E00-\u9FA5_.\\-]{0,128}$";

     String TRUE_STR = "TRUE";
     String FALSE_STR = "FALSE";



     /**
      * 易图通绑路支接口支持的最大数量
      */
     int EMAPGO_MATCH_MAX_GPS = 1000;

     /**
      * 道路对应的等级缓存
      * Map<String, RoadGradleInfo> ROAD_GRADLE_INFO_MAP = new HashMap<>(Constants.TWO_THOUSAND);
      */

     String COMMA = ",";

     String ROAD_DEFAULT_NAME = "本地路";

     int SCYLLA_DB_BATCH_SIZE = 500;



     /**
      * 不可分割符号
      */
     String SEPARATOR = String.valueOf((char) 0x01);
     String ES_GREATER = ">";
     String ES_LESS = "<";
     String ES_EQUAL = "=";

     String ES_GREATER_EQUAL = ">=";
     String ES_LESS_EQUAL = "<=";


     String DOUBLE_LOWER = "d";
     String DOUBLE_UN_LOWER = "D";
     String CODE = "code";

     String REQ_DATA_ERROR="dataError";

 	Double DOUBLE_ZERO = Double.valueOf(0.00D);

 	String DEFAULT_CHARSET = "UTF-8";
 	
 	char SEMICOLON = ';';

 	String DOT = ".";

    String UNDERLINE = "_";

    String TYPE_STRING = "String";

 	Pattern SPACE_REGEX = Pattern.compile("\\s+", Pattern.MULTILINE);

 	Pattern SEMICOLON_REGEX = Pattern.compile("\\s*;+\\s*", Pattern.MULTILINE);

 	Pattern COMMA_REGEX = Pattern.compile("\\s*,+\\s*", Pattern.MULTILINE);

 	Pattern COLON_REGEX = Pattern.compile("\\s*:+\\s*", Pattern.MULTILINE);

 	Pattern EQUAL_REGEX = Pattern.compile("\\s*=+\\s*", Pattern.MULTILINE);

 	Pattern TAB_REGEX = Pattern.compile("\\s*\\t+\\s*", Pattern.MULTILINE);

 	Pattern NEEDLESS_SPACE_REGEX = Pattern.compile("\\s{2,}", Pattern.MULTILINE);

 	Pattern CSV_FILTER_REGEX = Pattern.compile("^\\s*\"\\s*|\\s*\"\\s*$", Pattern.MULTILINE);

 	Pattern CSV_SPLIT_REGEX = Pattern.compile("\\s*(\")\\s*,\\s*\\1\\s*", Pattern.MULTILINE);

 	/** 特别行政区或者直辖市行政区域编码样式 */
 	Pattern MUNICIPALITY_OR_SPECIAL_ADCODE_REGEX = Pattern.compile("^(?:[18][12]|31|50)0[01]0{2}$", Pattern.MULTILINE);

 	Pattern PROVINCE_CODE_END_REGEX = Pattern.compile("0{3}$", Pattern.MULTILINE);
 	
 	Pattern CSV_END_REGEX = Pattern.compile("\\s*\"\\s*?$", Pattern.MULTILINE);

 	Pattern TYPE_WKT_REGEX = Pattern.compile(
 			"^\\s*((?:Multi\\s*)?(?:Polygon|Linestring|Point))(?:\\s*\\(){1,3}\\s*([-\\+]?(?:\\d|\\.)+?)\\s+?([-\\+]?(?:\\d|\\.)+?)[,\\)\\s]",
 			Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);

 	Pattern TYPE_GEOJSON_REGEX = Pattern.compile(
 			"\"\\s*type\\s*\"\\s*:\\s*\"\\s*((?:Multi\\s*)?(?:Polygon|Linestring|Point))\\s*\"(?:.|\\s)+?(?:\\s*\\[){1,4}\\s*([-\\+]?(?:\\d|\\.)+?)\\s*,+?\\s*([-\\+]?(?:\\d|\\.)+?)\\s*[\\]]",
 			Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);

 	Pattern ID_REGEX = Pattern.compile("^\\s*id\\s*$", Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);

 	List<Double> DOUBLE_LIST_EMPTY = new ArrayList<Double>(0);

}
